<?php

include "sendquery_db.php";


$username = $_GET['outer'];
$room = $_GET['out_room'];


$db = dbservice::getInstance();

$result = $db -> sendquery("select count(username) as count from participant where username = '$username' and roomnum=$room");


if ($result) {
	
	foreach ($result as $output) {


		if ($output['count'] == 1) {

			

			$result = $db -> sendquery("delete from participant where username = '$username' and roomnum=$room");
			echo 'out room';

		}else{
			
			echo 'not out room';
			
		}

	}

}

?>
